package com.gasolinator.a.app.activity;

import android.app.Activity;
import android.os.Bundle;
import android.webkit.WebSettings;
import android.webkit.WebView;
import com.gasolinator.a.R;
import com.gasolinator.a.util.XmlXslParser;

import java.util.Locale;

public class AboutActivity extends Activity
{
    private XmlXslParser xmlXslParser = null;

    public AboutActivity()
    {
       this.xmlXslParser = new XmlXslParser();
    }

	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);

              setContentView(R.layout.about);
              WebView webView =(WebView) findViewById(R.id.about);
              //NativeEngineWrapper nativeEngineWrapper = new NativeEngineWrapper(getBaseContext());
              Locale locale = Locale.getDefault();

//              final String displayLanguage = (locale.getLanguage().equals("es")) ? "es" : "en";
//              String xsl = "about/about_" + displayLanguage +".xsl";
//              StringBuilder xslContent = new StringBuilder();
//
//              BufferedReader xslBf = new BufferedReader(new InputStreamReader(getAssets().open(xsl)));
//              String line = "";
//              while((line=xslBf.readLine()) != null)
//              {
//                  xslContent.append(line);
//              }
//              Bundle extras = getIntent().getExtras();
//              String key = "";
//              if(extras !=null)
//              {
//                key = extras.getString("key");
//              }
//              Log.i("AboutActivityKey:", key);
////              String html = this.xmlXslParser.parseAbout(nativeEngineWrapper.getAbout(key), xslContent.toString());
//              String html = this.xmlXslParser.parseAbout(key, xslContent.toString());

             String html="<html><head></head><body><b>hello gasolinator!</b></body></html>";

             WebSettings settings = webView.getSettings();
             settings.setUseWideViewPort(true);
             settings.setLoadWithOverviewMode(true);
             webView.loadDataWithBaseURL(null, html, "text/html", "UTF-8", null);
	}
}
